package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.service.IKingTravelDetailService;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.KingTravelDetailMapper;
import com.ly.heart.domain.KingTravelDetailEntity;
import javax.annotation.Resource;

/**
 * 出差旅费报销单明细Service业务层处理
 * 
 * @author wutao
 * @date 2024-08-23
 */
@Service
public class KingTravelDetailServiceImpl extends ServiceImpl<KingTravelDetailMapper,KingTravelDetailEntity> implements IKingTravelDetailService {

    @Resource
    private KingTravelDetailMapper kingTravelDetailEntityMapper;

    /**
     * 查询出差旅费报销单明细
     * 
     * @param id 出差旅费报销单明细ID
     * @return 出差旅费报销单明细
     */
    @Override
    public KingTravelDetailEntity selectKingTravelDetailEntityById(String id)
    {
        return kingTravelDetailEntityMapper.selectKingTravelDetailEntityById(id);
    }

    /**
     * 查询出差旅费报销单明细列表
     * 
     * @param kingTravelDetailEntity 出差旅费报销单明细
     * @return 出差旅费报销单明细
     */
    @Override
    public List<KingTravelDetailEntity> selectKingTravelDetailEntityList(KingTravelDetailEntity kingTravelDetailEntity)
    {
        return kingTravelDetailEntityMapper.selectKingTravelDetailEntityList(kingTravelDetailEntity);
    }

    /**
     * 新增出差旅费报销单明细
     * 
     * @param kingTravelDetailEntity 出差旅费报销单明细
     * @return 结果
     */
    @Override
    public int insertKingTravelDetailEntity(KingTravelDetailEntity kingTravelDetailEntity)
    {
        kingTravelDetailEntity.setCreateTime(DateUtils.getNowDate());
        return kingTravelDetailEntityMapper.insertKingTravelDetailEntity(kingTravelDetailEntity);
    }

    /**
     * 修改出差旅费报销单明细
     * 
     * @param kingTravelDetailEntity 出差旅费报销单明细
     * @return 结果
     */
    @Override
    public int updateKingTravelDetailEntity(KingTravelDetailEntity kingTravelDetailEntity)
    {
        kingTravelDetailEntity.setUpdateTime(DateUtils.getNowDate());
        return kingTravelDetailEntityMapper.updateKingTravelDetailEntity(kingTravelDetailEntity);
    }

    /**
     * 批量删除出差旅费报销单明细
     * 
     * @param ids 需要删除的出差旅费报销单明细ID
     * @return 结果
     */
    @Override
    public int deleteKingTravelDetailEntityByIds(String[] ids)
    {
        return kingTravelDetailEntityMapper.deleteKingTravelDetailEntityByIds(ids);
    }

    /**
     * 删除出差旅费报销单明细信息
     * 
     * @param id 出差旅费报销单明细ID
     * @return 结果
     */
    @Override
    public int deleteKingTravelDetailEntityById(String id)
    {
        return kingTravelDetailEntityMapper.deleteKingTravelDetailEntityById(id);
    }
}
